package com.lcz.manage.sys.service.consumer.impl;


import com.lcz.manage.sys.service.consumer.IConsumer;
import com.lcz.manage.sys.service.consumer.factory.ConsumerFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Slf4j
@Component
public class MqConsumer implements IConsumer {

    @Autowired
    private ConsumerFactory consumerFactory;

    @Override
    public void apply(String consumerId) {
        log.info("consume mq:" + consumerId + " ...");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        consumerFactory.register(ConsumerFactory.ConsumerType.MQ, this);
    }

}
